package FeedbackedQuery;

import java.util.HashMap;




public class Article {
	protected String url;
	protected String title;
	protected String abs;
	protected boolean isRelevant; // if relevant, =1; otherwise = 0
	
	// count of all words;
	int wordCount;
	
	//The tf-idf vector
	double[] vector;
	
	/**
	 * Map from the word to its first position in the article
	 */
	HashMap<String, Integer>wordToPosMap;
	
	/**
	 * Map from word to its count in the article
	 */
	CountMap<String>wordToCountmap;
	
	
	
	
	public Article(){
		isRelevant = false;
		wordToPosMap = new HashMap<String, Integer>();
		wordToCountmap = new CountMap<String>();
		//url = "";
		//title = "";
		//abs = "";
	}
	public void setURL(String URL){url = URL;}
	
	public void setTitle(String Title){title = Title;}
	
	public void setAbstract(String Abs){abs = Abs;}
	
	public void setRelevance(boolean IsRelevant){isRelevant = IsRelevant;}
	
	public String getURL(){return url;}
	
	public String getTitle(){return title;}
	
	public String getAbstract(){return abs;}
	
	public boolean getRelevance(){return isRelevant;}
	
	
	// This is used in decide if articles retrieved from two runs are the same one.
	public boolean equals(Object obj)
	{
		Article toCompare = (Article)obj;
		return this.url.equals(toCompare.url);
	}
}
